<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libCZI: libCZI Documentation</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" async src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">libCZI
   </div>
   <div id="projectbrief">Reading CZI documents made easy</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('index.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title"><a class="el" href="namespacelib_c_z_i.html" title="External interfaces, classes, functions and structs are found in the namespace &quot;libCZI&quot;. ">libCZI</a> Documentation </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p><a class="el" href="namespacelib_c_z_i.html" title="External interfaces, classes, functions and structs are found in the namespace &quot;libCZI&quot;. ">libCZI</a> is a library intended for providing read-only access to the information contained in CZI-documents. <br />
</p>
<p>It features</p><ul>
<li>reading subblocks and get the content as a bitmap</li>
<li>reading subblocks which are compressed with JPEG-XR</li>
<li>works with tiled images and pyramid images</li>
<li>composing multi-channel images with tinting and applying a gradation curve</li>
<li>access metadata</li>
</ul>
<p>In a nutshell, it offers (almost...) the same functionality as the 2D-viewer in ZEN - in terms of composing the image (including display-settings) and managing the data found in a CZI-file.</p>
<div class="image">
<img src="ZEN_screenshot_1.PNG" alt="ZEN_screenshot_1.PNG"/>
<div class="caption">
ZEN - 2D-viewer</div></div>
 The code is written in C++11 and (so far) has been successfully compiled with</p><ul>
<li>Visual Studio 2015 (Microsoft C++ v. 19.00.23506)</li>
<li>GCC 5.2.1 (on Ubuntu Linux 4.2.0)</li>
<li>Clang 3.4.1 (on FreeBSD 10.2)</li>
</ul>
<p>It is intended to be easily portable to other platforms. <br />
 It aims to be thread-safe (by most <a href="https://en.wikipedia.org/wiki/Thread_safety">definitions</a>) - which isn't too surprising since it only allows read-only functionality. The library itself does not leverage multithreading, but it is designed for being used in a multithreaded environment.</p>
<h1>CZI in a nutshell </h1>
<p>Conceptionally a CZI-document can be described as a set of blobs (or blocks - in this context just a binary data structure defined only by its length), which are linked by a directory structure.</p>
<div class="image">
<img src="CZI_1.PNG" alt="CZI_1.PNG"/>
<div class="caption">
CZI - conceptual overview</div></div>
 At the start of the file, there is a distinguished data-structure ("the header") which (amongst other things) contains the offsets of three other special blocks:</p>
<ul>
<li>the metadata block (contains all "per document" metadata in XML-format)</li>
<li>sub-block directory (contains a list of all sub-blocks contained in the document and their respective position in the file)</li>
<li>the attachment directory (contains a list of all attachment-blocks contained in the document and their respective position in the file)</li>
</ul>
<p>With the term <em>sub-block</em> we are referring to an entity which contains a 2-dimensional image (or "a bitmap"), some associated metadata in XML-format (which we refer to as <em>sub-block metadata</em>) and (potentially) some other binary attachment (referred to as <em>sub-block attachment</em>).<br />
Do not confuse the terms "sub-block metadata"↔"metadata" and "sub-block attachment"↔"attachment" in this regard. Sub-blocks are identified by something like a coordinate - a list of dimensions and for each dimension a value.</p>
<p>Attachments can contain any sort of binary data (their content is not further defined on the file-format level). They are identified by a string. A naming convention is used to discover their content.</p>
<p>The identifier (or coordinate) of a sub-block can be grouped in two categories: a number of abstract dimensions (abstract in the sense that the number is not directly related to a spatial point) and an X-Y-coordinate in a 2D-plane. Examples for the former are "C-dimension" (used for different channels) or "T-dimensions" (used for images acquired at different points in time) → <a class="el" href="namespacelib_c_z_i.html#a55049658acf59d0eddfaebcad16df424">cf. DimensionIndex</a>. The X-Y-coordinate refer to a common (to all sub-blocks) coordinate system in which the sub-blocks are thought to be arranged. In fact - sub-blocks are not only described by their X-Y-coordinate, but by a complete rectangle (adding witdth and height to the X-Y-coordinate) - called the <em>logical rect</em>. And, in addition there is a parameter <em>physical width</em> and <em>physical height</em> → <a class="el" href="structlib_c_z_i_1_1_sub_block_info.html">cf. SubBlockInfo</a>.<br />
 </p><div class="image">
<img src="CZI_2.PNG" alt="CZI_2.PNG"/>
<div class="caption">
CZI - position of sub-block on plane</div></div>
 So the logical_rect defines the position (and size) of the sub-block on a plane. The physical_size gives the width and height of the bitmap contained in the sub-block. They may or may not coincide with each other. If they do not coincide, then conceptually the bitmap is to be considered to have a different resolution - so that we do not have a one-to-one correspondence between a pixel and an increment by 1 on the X- or Y-coordinate. This concept is leveraged in order to have a resolution pyramid available in a CZI-document. </p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
  </ul>
</div>
</body>
</html>
